(require 'cl)
;; require file auto-complete*.el popup.el
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/emacs/mypath/ac-dict")
(set-face-background 'ac-selection-face "tan4")
(ac-config-default)
(setq ac-delay 0.5)
(defun ac-ispell-get-candidates ()
  (let ((word (car (ispell-get-word nil "\\*")))
        (interior-frag nil))
    (lookup-words (concat (and interior-frag "*") word
				    (if (or interior-frag (null ispell-look-p))
					"*"))
                  ispell-complete-word-dict)))

(ac-define-source ispell
  '((symbol . "i")
    (candidates . ac-ispell-get-candidates)))

(defun ac-expand-ispell-word ()
  (interactive)
  (let ((ac-sources '(ac-source-ispell)))
    (call-interactively 'ac-start)))

(provide 'ac-mode-setting)
